<table class="layui-table text-center" lay-size="sm">
    <thead>
        <tr>
            <th>图片</th>
            <th>SKU</th>
            <th>商品名称</th>
            <th>区域</th>
            <th>货架编号</th>
            <th>库位</th>
            <th>在货架层数</th>
            <th>可用库存</th>
            <th>占用库存</th>
            <th>在途库存</th>
            <th>净重(g)</th>
            <th>包装重(g)</th>
            <th>状态</th>
            <th>备注</th>
        </tr>
    </thead>
    <tbody>
        {foreach $stock as $item}
        <tr>
            <td width="100">{if $item.store}<img src="{$item.store.image_url}">{/if}</td>
            <td class="copy-text">{$item.sku}</td>
            <td>{$item.store?$item.store.product.name_ch:''}</td>
            <td>{$item.location?$item.location.shelf.area.name:''}</td>
            <td>{$item.location?$item.location.shelf.code:''}</td>
            <td>{$item.location?$item.location.code:''}</td>
            <td>{$item.location&&$item.location.floor?$item.location.floor:''}</td>
            <td>{$item.stock}</td>
            <td>{$item.lock_stock}</td>
            <td>{$item.purchase_stock}</td>
            <td>{$item.store?$item.store.weight:''}</td>
            <td>{$item.store?$item.store.package_weight:''}</td>
            <td>{$item.status?'<i class="fa fa-unlock"></i>':'<i class="fa fa-lock text-red"></i>'}</td>
            <td class="text-left">{$item.remark}</td>
        </tr>
        {/foreach}
    </tbody>
</table>